package cloudAlibaba.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author: Liuzihao
 * @Description:
 * @Date Created in 2022-04-14 16:00
 * @Modified By:
 */
@RestController
public class ConsumerController {
    @Value("${service-url.nacos-user-service}")
    String serviceURL;
    @Resource
    RestTemplate restTemplate;

    @GetMapping("/payment/nacos/{id}")
    public String paymentInfo(@PathVariable("id") Long id) {
        return restTemplate.getForObject(serviceURL + "/payment/nacos/" + id, String.class);
    }
}
